module.exports = app => {
    const { STRING, INTEGER, TEXT, DATE, BIGINT } = app.Sequelize;

    const Comment = app.model.define('comment', {
        comment_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        post_id: { type: BIGINT.UNSIGNED, allowNull: false },
        user_id: { type: BIGINT.UNSIGNED, allowNull: false },
        content: { type: TEXT, allowNull: false },
        parent_id: { type: BIGINT.UNSIGNED, allowNull: true },
        created_at: DATE,
        updated_at: DATE,
    }, {
        tableName: 'comments',
        timestamps: false,
    });

    return Comment;
};